package com.example.demoasync.service;

import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import java.lang.reflect.Method;

/**
 * 类${CLASS_NAME}的实现描述：
 *
 * @Author liyanjun 2018-12-27 14:52
 */
public class CustomAsyncExceptionHandler implements AsyncUncaughtExceptionHandler {
    @Override
    public void handleUncaughtException(Throwable throwable, Method method, Object... objects) {
        System.out.println("Exception message - " + throwable.getMessage());
        System.out.println("Method name - " + method.getName());
        for (final Object param : objects) {
            System.out.println("Param - " + param);
        }
    }

}
